package com.tinghua.repositories;

import com.tinghua.pojo.Customer;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface CustomerMethodNameRepository extends PagingAndSortingRepository<Customer, Long> {
    List<Customer> findCustomerByCustName(String custName);
    //注意，增删改要有下面两个注解
    @Transactional
    @Modifying
    int removeCustomerByCustId(Long id);
    //模糊查询
    List<Customer> findByCustNameLike(String name);
}
